{% block content %}
    {% load static %}
    <!doctype html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>MobSF静态扫描测试报告</title>
        <meta name="description" content="MobSF Report">
        {% if host_os == 'windows' %}
            <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
            <link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
        {% else %}
            <style>

                /* latin */
                @font-face {
                    font-family: 'Open Sans';
                    font-style: normal;
                    font-weight: 400;
                    font-display: swap;
                    src: local('Open Sans Regular'), local('OpenSans-Regular'), url('{{base_url}}{% static 'fonts/Open_Sans/OpenSans-Regular.ttf' %}') format('truetype');
                }

                /* latin */
                @font-face {
                    font-family: 'Oswald';
                    font-style: normal;
                    font-weight: 400;
                    font-display: swap;
                    src: local('Oswald'), local('Oswald'), url('{{base_url}}{% static 'fonts/Oswald/Oswald-Regular.ttf' %}') format('truetype');
                }

            </style>
        {% endif %}
        <link rel="stylesheet" href="{{ base_url }}{% static "others/css/pdf_report.css" %}">
        <link rel="stylesheet" href="{{ base_url }}{% static "adminlte/plugins/fontawesome-free/css/all.min.css" %}">
    </head>

    <body bgcolor="FFFFFF">
    <article id="cover">
        <div class="header">
            <img src="{{ base_url }}{% static "img/mobsf_logo.png" %}" class="center logo" alt="MobSF Logo"/>
            <div class="htext">安卓静态分析报告</div>
        </div>
        </br></br></br>
        <div class="app">
            <img class="center" id="icon" src="
                    {% if icon_found %}{{ dwd_dir }}{{ md5 }}-icon.png{% else %}{{ base_url }}{% static 'img/no_icon.png' %}{% endif %}"
                 alt="app_icon"/>
        </div>
        <div class="center">
            <h1><i class="fab fa-android"></i> {{ app_name }} {% if version_name %}  ({{ version_name }}) {% endif %}
            </h1>
        </div>
        </br></br></br></br></br>
        <div class="container">
            <table class="basic no_border">
                <tr class="no_border">
                    <td class="no_border"><h3>文件名称:</h3></td>
                    <td class="no_border"><h3>{{ file_name }}</h3></td>
                </tr>
                <tr>
                    <td class="no_border"><h3>包名:</h3></td>
                    <td class="no_border"><h3>{{ package_name }}</h3></td>
                </tr>
                <tr>
                    <td class="no_border"><h3>平均 CVSS 分数:</h3></td>
                    <td class="no_border"><h3>

                        {% if average_cvss > 6 %}
                            <span class="danger">{{ average_cvss }} </span>
                        {% elif average_cvss == 0 %}
                            {{ average_cvss }}
                        {% elif average_cvss >= 4 %}
                            <span class="warning">{{ average_cvss }}</span>
                        {% elif average_cvss < 4 %}
                            <span class="success">{{ average_cvss }}</span>
                        {% endif %}
                    </h3></td>
                </tr>
                <tr>
                    <td class="no_border"><h3>应用安全评分:</h3></td>
                    <td class="no_border">
                        <h3>
                            {% if security_score < 16 %}
                                <span class="danger">{{ security_score }}/100 (CRITICAL RISK)</span>
                            {% elif security_score < 41 %}
                                <span class="high">{{ security_score }}/100 (HIGH RISK)</span>
                            {% elif security_score < 71 %}
                                <span class="warning">{{ security_score }}/100 (MEDIUM RISK)</span>
                            {% else %}
                                <span class="success">{{ security_score }}/100 (LOW RISK)</span>
                            {% endif %}
                        </h3>
                    </td>
                </tr>
                {% if trackers|key:"trackers" %}
                    <tr>
                        <td class="no_border"><h3>Trackers Detection:</h3></td>
                        <td class="no_border"><h3><span {% if trackers.detected_trackers > 0 %}
                            class="warning" {% endif %}>{{ trackers.detected_trackers }}/{{ trackers.total_trackers }}</span>
                        </h3></td>
                    </tr>
                {% endif %}
                {% if virus_total and virus_total.items|length > 9 and 'request successfully queued' not in virus_total.verbose_msg %}
                    <tr>
                        <td class="no_border"><h3>VirusTotal Detection:</h3></td>
                        <td class="no_border"><h3><span
                                class="{% if virus_total.positives > 0 %}danger{% else %}success{% endif %}"> {{ virus_total.positives }}/{{ virus_total.total }}</span>
                        </h3></td>
                    </tr>
                {% endif %}
                <tr>
                    <td class="no_border"><h3>扫描日期:</h3></td>
                    <td class="no_border"><h3>{{ timestamp }}</h3></td>
                </tr>
            </table>
        </div>
        </br></br>
        </br></br>
        </br></br>
        </br></br>
        </br></br>
        </br></br>
        </br></br>
        </br></br>
    </article>

    <article id="contents">


        <h2><i class="fas fa-box-open"></i> 文件信息</h2>

        <h5>文件名称:</h5> {{ file_name }}</br>
        <h5>大小: </h5> {{ size }}</br>
        <h5>MD5:</h5> {{ md5 }}</br>
        <h5>SHA1:</h5> {{ sha1 }}</br>
        <h5>SHA256:</h5> {{ sha256 }}</br>


        <h2><i class="fas fa-info"></i> app信息</h2>

        <h5>app名称:</h5> {{ app_name }}</br>
        <h5>包名:</h5> {{ package_name }}</br>
        <h5>主Activity:</h5> {{ main_activity }}</br>
        <h5>Target SDK:</h5> {{ target_sdk }}</br>
        <h5>最小SDK:</h5> {{ min_sdk }}</br>
        <h5>最大SDK:</h5> {{ max_sdk }}</br>
        <h5>Android Version Name:</h5> {{ version_name }}</br>
        <h5>Android Version Code:</h5> {{ version_code }}</br>

        <h2><i class="fas fa-th-large"></i> APP COMPONENTS </h2>

        <h5>Activities:</h5> {{ activities | length }}</br>
        <h5>Services:</h5> {{ services | length }}</br>
        <h5>Receivers:</h5> {{ receivers | length }}</br>
        <h5>Providers:</h5> {{ providers | length }}</br>
        <h5>Exported Activities:</h5> <span {% if exported_count.exported_activities > 0 %}
        class="danger" {% endif %}> {{ exported_count.exported_activities }}</span></br>
        <h5>Exported Services:</h5> <span {% if exported_count.exported_services > 0 %}
        class="danger" {% endif %}> {{ exported_count.exported_services }}</span></br>
        <h5>Exported Receivers:</h5> <span {% if exported_count.exported_receivers > 0 %}
        class="danger" {% endif %}> {{ exported_count.exported_receivers }}</span></br>
        <h5>Exported Providers:</h5> <span {% if exported_count.exported_providers > 0 %}
        class="danger" {% endif %}> {{ exported_count.exported_providers }}</span></br>

        <h2><i class="fa fa-certificate"></i> 证书信息</h2>
        {% if certificate_analysis.certificate_info %}
            <div class="panel-body">
                <p class="wrapped-text">{{ certificate_analysis.certificate_info }}</p>
                <!--Cert status-->
                <table class="basic">
                    <thead>
                    <tr>
                        <th>状态</th>
                        <th>描述</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for find in certificate_analysis.certificate_findings %}
                        <tr>
                            <td>
                                {% if find.0 == 'bad' %}
                                    <span class="danger">坏</span>
                                {% elif find.0  == 'good' %}
                                    <span class="success">安全</span>
                                {% elif find.0  == 'warning' %}
                                    <span class="warning">警告</span>
                                {% endif %}
                            </td>
                            <td>{{ find.1 }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        {% else %}
            <span class="danger">无法读取代码签名证书或没有可用的.</span>
        {% endif %}
        {% if permissions %}
            <h2><i class="fa fa-list"></i>App申请权限</h2>

            <table class="basic">
                <thead>
                <tr>
                    <th>权限</th>
                    <th>状态</th>
                    <th>信息</th>
                    <th>描述</th>
                </tr>
                </thead>
                <tbody>
                {% for perm,desc in permissions.items %}
                    <tr>
                        <td>{{ perm }}</td>
                        <td>
                            {% if desc.status == 'dangerous' %}
                                <span class="danger">危险</span>
                            {% elif desc.status == 'normal' %}
                                <span class="info">信息</span>
                            {% elif desc.status == 'signatureOrSystem' %}
                                <span class="warning">警告</span>
                            {% elif desc.status == 'signature' %}
                                <span class="success">安全</span>
                            {% elif desc.status == 'unknown' %}
                                <span class="secondary">未知</span>
                            {% endif %}
                        </td>
                        <td>{{ desc.info }}</td>
                        <td>{{ desc.description }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}


        {% if virus_total and virus_total.items|length > 9 and 'request successfully queued' not in virus_total.verbose_msg %}
            <h2><i class="fas fa-spider"></i> 病毒扫描</h2>
            <p> <h5>{{ virus_total.positives }} / {{ virus_total.total }}</h5> &nbsp; AV 发现此文件恶意!
            </p>
            {% if virus_total.positives %}

                <table class="basic">
                    <thead>
                    <tr>
                        <th>AV</th>
                            <th>发现</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for av_name,av_result in virus_total.scans.items %}
                        {% if av_result.detected == True %}
                            <tr>
                                <td>
                                    {{ av_name }}
                                </td>
                                <td>
                                    <span class="danger">{{ av_result.result }}</span>
                                </td>
                            </tr>
                        {% endif %}
                    {% endfor %}
                    </tbody>
                </table>
            {% endif %}
        {% endif %}
        {% if apkid %}
            <h2><i class="fas fa-fingerprint"></i> APKID ANALYSIS</h2>

            <table class="basic">
                <thead>
                <tr>
                    <th>文件</th>
                    <th>细节</th>
                </tr>
                </thead>
                <tbody>
                {% if apkid %}
                    {% for file, details in apkid.items %}
                        <tr>
                            <td>
                                {{ file }}
                            </td>
                            <td>
                                <table class="basic">
                                    <thead>
                                    <tr>
                                        <th>发现</th>
                                        <th>细节</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {% for detail, idens in details.items %}
                                        <tr>
                                            <td>
                                                {% if detail == "anti_vm" %}
                                                    <span class="warning">Anti-VM Code</span>
                                                {% elif detail == "anti_disassembly" %}
                                                    <span class="warning">Anti Disassembly Code</span>
                                                {% elif detail == "anti_debug" %}
                                                    <span class="warning">Anti Debug Code</span>
                                                {% elif detail == "compiler" %}
                                                    <span class="info">Compiler</span>
                                                {% elif detail == "abnormal" %}
                                                    <span class="warning">Abnormal Code</span>
                                                {% elif detail == "obfuscator" %}
                                                    <span class="warning">Obfuscator</span>
                                                {% elif detail == "protector" %}
                                                    <span class="info">Protector</span>
                                                {% elif detail == "packer" %}
                                                    <span class="danger">Packer Found</span>
                                                {% elif detail == "dropper" %}
                                                    <span class="danger">Dropper Found</span>
                                                {% elif detail == "manipulator" %}
                                                    <span class="warning">Manipulator Found</span>
                                                {% else %}
                                                    <span class="info">{{ detail }}</span>
                                                {% endif %}
                                            </td>
                                            <td> {% for idn in idens %} {{ idn }}</br> {% endfor %}</td>
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </td>

                        </tr>
                    {% endfor %}
                {% else %}
                    <p align="center"><strong>APKiD not enabled.</strong></p>
                {% endif %}
                </tbody>
            </table>
        {% endif %}
        {% if browsable_activities %}
            <h2><i class="fas fa-clone"></i> BROWSABLE ACTIVITIES</h2>
            <table class="basic">
                <thead>
                <tr>
                    <th>ACTIVITY</th>
                    <th>INTENT</th>
                </tr>
                </thead>
                <tbody>
                {% for activity,intent_details in browsable_activities.items %}
                    <tr>
                    <td>{{ activity }}</td>
                    <td>
                    {% if intent_details|key:"schemes" %}
                        <strong>Schemes</strong>:
                        {% for scheme in intent_details|key:"schemes" %}
                            {{ scheme }},
                        {% endfor %}
                        </br>
                    {% endif %}
                    {% if intent_details|key:"hosts" %}
                        <strong>Hosts:</strong> {% for host in intent_details|key:"hosts" %}
                        {{ host }},
                    {% endfor %}
                        </br>
                    {% endif %}
                    {% if intent_details|key:"ports" %}
                        <strong>Ports:</strong> {% for port in intent_details|key:"ports" %}
                        {{ port }},
                    {% endfor %}
                        </br>
                    {% endif %}
                    {% if intent_details|key:"mime_types" %}
                        <strong>Mime Types:</strong> {% for mime in intent_details|key:"mime_types" %}
                        {{ mime }},
                    {% endfor %}
                        </br>
                    {% endif %}
                    {% if intent_details|key:"paths" %}
                        <strong>Paths:</strong> {% for path in intent_details|key:"paths" %}
                        {{ path }},
                    {% endfor %}
                        </br>
                    {% endif %}
                    {% if intent_details|key:"path_prefixs" %}
                        <strong>Path Prefixes:</strong> {% for prefix in intent_details|key:"path_prefixs" %}
                        {{ prefix }},
                    {% endfor %}
                        </br>
                    {% endif %}
                    {% if intent_details|key:"path_patterns" %}
                        <strong>Path Patterns:</strong> {% for pattern in intent_details|key:"path_patterns" %}
                        {{ pattern }},
                    {% endfor %}
                        </br>
                    {% endif %}
                {% endfor %}
                </td>
                </tr>
                </tbody>
            </table>
        {% endif %}


        <h2><i class="fas fa-lock"></i> NETWORK SECURITY</h2>
        <table class="basic">
            <thead>
            <tr>
                <th>NO</th>
                <th>SCOPE</th>
                <th>SEVERITY</th>
                <th>DESCRIPTION</th>
            </tr>
            </thead>
            <tbody>
            {% for item in network_security %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>
                        {% for url in item.scope %}
                            {{ url }}</br>
                        {% endfor %}
                    </td>
                    <td>
                        {% if item.severity == "high" %}
                            <span class="danger">high</span>
                        {% elif item.severity == "good" %}
                            <span class="good">good</span>
                        {% elif item.severity == "info" %}
                            <span class="info">info</span>
                        {% elif item.severity == "warning" %}
                            <span class="warning">warning</span>
                        {% endif %}
                    </td>
                    <td>
                        {{ item.description }}
                    </td>

                </tr>
            {% endfor %}
            </tbody>
        </table>

        <h2><i class="fas fa-search"></i> MANIFEST ANALYSIS</h2>
        <table class="basic">
            <thead>
            <tr>
                <th>标号</th>
                <th>问题</th>
                <th>严重性</th>
                <th>描述</th>
            </tr>
            </thead>
            <tbody>
            {% for item in manifest_analysis %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>
                        {{ item|key:"title" | safe }}
                    </td>
                    <td>

                        {% if item|key:"stat" == "high" %}
                            <span class="danger">高</span>
                        {% elif item|key:"stat" == "info" %}
                            <span class="info">信息</span>
                        {% elif item|key:"stat" == "medium" %}
                            <span class="warning">中</span>
                        {% endif %}

                    </td>
                    <td>
                        {{ item|key:"desc" }}
                    </td>

                </tr>
            {% endfor %}


            </tbody>
        </table>

        <h2><i class="fas fa-code"></i> CODE ANALYSIS</h2>
        <table class="basic">
            <thead>
            <tr>
                <th>标号</th>
                <th>问题</th>
                <th>严重性</th>
                <th>标准</th>
                <th>文件</th>
            </tr>
            </thead>
            <tbody>
            {% for rule, details in code_analysis.items %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td width="25%">
                        {% if details.metadata|key:"ref" %}
                            <a href="{{ details.metadata.ref }}" target="_blank"
                               rel="noopener"> {{ details.metadata.description }}</a>
                        {% else %}
                            {{ details.metadata.description }}
                        {% endif %}
                    </td>
                    <td>
                        {% if details.metadata.severity == "high" %}
                            <span class="danger">高</span>
                        {% elif details.metadata.severity == "good" %}
                            <span class="success">安全</span>
                        {% elif details.metadata.severity == "warning" %}
                            <span class="warning">警告</span>
                        {% elif details.metadata.severity == "info" %}
                            <span class="info">信息</span>
                        {% endif %}
                    </td>
                    <td>
                        <strong>CVSS V2:</strong>
                        {{ details.metadata.cvss }}
                        {% if details.metadata.cvss > 6 %}
                            <span class="danger"> (high)</span>
                        {% elif details.metadata.cvss == 0 %}
                            <span class="info">(info)</span>
                        {% elif details.metadata.cvss >= 4 %}
                            <span class="warning"> (medium)</span>
                        {% elif details.metadata.cvss < 4 %}
                            <span class="success"> (low)</span>
                        {% endif %}
                        {% if details.metadata.cwe %}</br> <strong>CWE: </strong>{{ details.metadata.cwe }}{% endif %}
                        {% if details.metadata|key:"owasp-mobile" %}</br> <strong>OWASP Top 10: </strong>
                            {{ details.metadata|key:"owasp-mobile" }}{% endif %}
                        {% if details.metadata.masvs %}</br> <strong>OWASP MASVS: </strong>
                            {{ details.metadata.masvs }}{% endif %}
                    </td>
                    <td style="word-break:break-all;">
                        {% for file_path in details.files %}
                            {{ file_path }}
                            <br/>
                        {% endfor %}
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>

        {% if binary_analysis %}
            <h2><i class="fa fa-flag"></i> SHARED LIBRARY BINARY ANALYSIS</h2>

            <table class="basic">
                <thead>
                <tr>
                    <th>NO</th>
                    <th>SHARED OBJECT</th>
                    <th>NX</th>
                    <th>STACK CANARY</th>
                    <th>RELRO</th>
                    <th>RPATH</th>
                    <th>RUNPATH</th>
                    <th>FORTIFY</th>
                    <th>SYMBOLS STRIPPED</th>
                </tr>
                </thead>
                <tbody>
                {% if not binary_analysis %}
                    未找到共享对象.
                {% endif %}
                {% for so in binary_analysis %}
                    <tr>
                        <td>{{ forloop.counter }}</td>
                        <td width="20%">{{ so.name }}</td>
                        <td style="vertical-align: top;"><b>{{ so.nx.is_nx }}</b>
                            <br/>
                            <span class="{% if so.nx.severity == 'high' %}danger{% elif so.nx.severity == 'warning' %}warning{% else %}info{% endif %}">{{ so.nx.severity }}</span>
                            <br/>{{ so.nx.description }}</td>
                        <td style="vertical-align: top;"><b>{{ so.stack_canary.has_canary }}</b>
                            <br/>
                            <span class="{% if so.stack_canary.severity == 'high' %}danger{% elif so.stack_canary.severity == 'warning' %}warning{% else %}info{% endif %}">{{ so.stack_canary.severity }}</span>
                            <br/>{{ so.stack_canary.description }}</td>
                        <td style="vertical-align: top;"><b>{{ so.relocation_readonly.relro }}</b>
                            <br/>
                            <span class="{% if so.relocation_readonly.severity == 'high' %}danger{% elif so.relocation_readonly.severity == 'warning' %}warning{% else %}info{% endif %}">{{ so.relocation_readonly.severity }}</span>
                            <br/>{{ so.relocation_readonly.description }}</td>
                        <td style="vertical-align: top;"><b>{{ so.rpath.rpath }}</b>
                            <br/>
                            <span class="{% if so.rpath.severity == 'high' %}danger{% elif so.rpath.severity == 'warning' %}warning{% else %}info{% endif %}">{{ so.rpath.severity }}</span>
                            <br/>{{ so.rpath.description }}</td>
                        <td style="vertical-align: top;"><b>{{ so.runpath.runpath }}</b>
                            <br/>
                            <span class="{% if so.runpath.severity == 'high' %}danger{% elif so.runpath.severity == 'warning' %}warning{% else %}info{% endif %}">{{ so.runpath.severity }}</span>
                            <br/>{{ so.runpath.description }}</td>
                        <td style="vertical-align: top;"><b>{{ so.fortify.is_fortified }}</b>
                            <br/>
                            <span class="{% if so.fortify.severity == 'high' %}danger{% elif so.fortify.severity == 'warning' %}warning{% else %}info{% endif %}">{{ so.fortify.severity }}</span>
                            <br/>{{ so.fortify.description }}</td>
                        <td style="vertical-align: top;"><b>{{ so.symbol.is_stripped }}</b>
                            <br/>
                            <span class="{% if so.symbol.severity == 'high' %}danger{% elif so.symbol.severity == 'warning' %}warning{% else %}info{% endif %}">{{ so.symbol.severity }}</span>
                            <br/>{{ so.symbol.description }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}

        <h2><i class="fa fa-id-badge"></i> NIAP ANALYSIS v1.3</h2>
        <table class="basic">
            <thead>
            <tr>
                <th>标号</th>
                <th>确认</th>
                <th>要求</th>
                <th>特征</th>
                <th>描述</th>
            </tr>
            </thead>
            <tbody>
            {% for iden, details in niap_analysis.items %}
                <tr>
                    <td>{{ forloop.counter }}</td>
                    <td>
                        <span class="{% if 'does not' in details.choice %} warning {% elif 'not in accordance' in details.choice %} danger {% else %} info {% endif %}"> {{ iden }}</span>
                    </td>
                    <td>
                        {{ details.class }}
                    </td>
                    <td>
                        {{ details.description }}
                    </td>
                    <td>
                        {{ details.choice }}
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>

        {% if domains %}
            <h2><i class="fab fa-searchengin"></i> 域恶意软件检查</h2>
            <table class="basic">
                <thead>
                <tr>
                    <th>域</th>
                    <th>状态</th>
                    <th>地理位置</th>
                </tr>
                </thead>
                <tbody>
                {% for domain, details in domains.items %}
                    <tr>
                        <td>{{ domain }}</td>
                        <td>

                            {% if details|key:"bad" == "yes" %}
                                <span class="danger">malware</span><br/>

                                <h5>URL: </h5> {{ details|key:"domain_or_url" }}
                                <h5>IP: </h5> <span class="danger">{{ details|key:"ip" }}</span>
                                <h5>Description: </h5> {{ details|key:"desc" }}

                            {% else %}
                                <span class="success">good</span><br/>
                            {% endif %}
                        </td>
                        <td>
                            {% if details|key:"geolocation" %}

                                <h5>IP: </h5> {{ details|key:"geolocation"|key:"ip" }}  <br/>
                                <h5>Country: </h5> {{ details|key:"geolocation"|key:"country_long" }} <br/>
                                <h5>Region: </h5> {{ details|key:"geolocation"|key:"region" }} <br/>
                                <h5>City: </h5> {{ details|key:"geolocation"|key:"city" }} <br/>
                                <h5>Latitude: </h5> {{ details|key:"geolocation"|key:"latitude" }} <br/>
                                <h5>Longitude: </h5> {{ details|key:"geolocation"|key:"longitude" }} <br/>
                                <h5>View: </h5><a target="_blank"
                                                  href="http://maps.google.com/maps?q={{ details|key:"geolocation"|key:"latitude" }},{{ details|key:"geolocation"|key:"longitude" }}">Google
                                Map</a>
                            {% else %}
                                没有可用的地理位置信息.
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}

        {% if urls %}
            <h2><i class="fas fa-globe"></i> URLS </h2>
            <table class="basic">
                <thead>
                <tr>
                    <th>URL</th>
                    <th>FILE</th>
                </tr>
                </thead>
                <tbody>
                {% for urldict in urls %}
                    <tr>
                        <td style="word-break:break-all;">
                            {% for u in urldict|key:"urls" %}
                                {{ u }} </br>
                            {% endfor %}
                        </td>
                        <td style="word-break:break-all;">
                            {{ urldict|key:"path" }}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}

        {% if firebase_urls %}
            <h2><i class="fas fa-database"></i> FIREBASE DATABASES</h2>
            <table class="basic">
                <thead>
                <tr>
                    <th>FIREBASE URL</th>
                    <th>DETAILS</th>
                </tr>
                </thead>
                <tbody>
                {% for item in firebase_urls %}
                    <tr>
                        <td>
                            {{ item.url }}
                        </td>
                        <td>
                            {% if item.open %}
                                <span class="danger">insecure</span></br>Firebase DB is exposed publically.
                            {% else %}
                                <span class="info">info</span></br>App talks to a Firebase Database.
                            {% endif %}

                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}



        {% if emails %}
            <h2><i class="fas fa-envelope"></i> EMAILS</h2>
            <table class="basic">
                <thead>
                <tr>
                    <th>EMAIL</th>
                    <th>FILE</th>
                </tr>
                </thead>
                <tbody>
                {% for email_dict in emails %}
                    <tr>
                        <td style="word-break:break-all;">
                            {% for em in email_dict|key:"emails" %}
                                {{ em }} </br>
                            {% endfor %}
                        </td>

                        <td style="word-break:break-all;">
                            {{ email_dict|key:"path" }}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}


        {% if trackers|key:"trackers" %}
            <h2><i class="fas fa-user-secret"></i> TRACKERS</h2>
            <table class="basic">
                <thead>
                <tr>
                    <th>TRACKER</th>
                    <th>CATEGORIES</th>
                    <th>URL</th>
                </tr>
                </thead>

                <tbody>
                {% for trk in trackers|key:"trackers" %}
                    <tr>
                        <td>
                            {{ trk.name }}
                        </td>
                        <td>
                            {{ trk.categories }}
                        </td>
                        <td>
                            <a target="_blank" href="{{ trk.url }}" rel="noopener noreferrer">{{ trk.url }}</a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}

        {% if secrets %}
            <h2><i class="fas fa-key"></i> HARDCODED SECRETS</h2>
            <table class="basic">
                <thead>
                <tr>
                    <th>POSSIBLE SECRETS</th>
                </tr>
                </thead>
                <tbody>
                {% for sec in secrets %}
                    <tr>
                        <td style="word-break:break-all;">
                            {{ sec }}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% endif %}

        {% if not playstore_details.error %}
            <h2><i class="fab fa-google-play"></i> PLAYSTORE INFORMATION </h2>

            <p>
            <h5>Title:</h5>
            {{ playstore_details.title }}
            </p>
            <p>
            <h5>Score:</h5>
            {{ playstore_details.score }}

            <h5>Installs:</h5>
            {{ playstore_details.installs }}

            <h5>Price:</h5>
            {{ playstore_details.price }}

            <h5>Android Version Support:</h5>
            {{ playstore_details.androidVersionText }}

            <h5>Category:</h5>
            {{ playstore_details.genre }}

            <h5>Play Store URL:</h5>
            <a target="_blank" href="{{ playstore_details.url }}" rel="noopener noreferrer"> {{ package_name }} </a>
            </p>

            <p>
            <h5>Developer Details:</h5>
            {{ playstore_details.developer }},
            {{ playstore_details.developerId }},
            {{ playstore_details.developerAddress }},
            {{ playstore_details.developerWebsite }},
            {{ playstore_details.developerEmail }},
            </p>
            <p>
            <h5>Release Date:</h5>
            {{ playstore_details.released }}
            <h5>Privacy Policy:</h5>
            <a target="_blank" href="{{ playstore_details.privacyPolicy }}" rel="noopener noreferrer">Privacy link</a>
            </p>
            <p>
            <h5>Description:</h5>
            <p>{{ playstore_details.description }}</p>
            </p>

        {% endif %}
    </article>
    <article>
        </br>
        <h3> 应用安全评分计算 </h3>
        <p>
            开始时，每个应用程序都获得了 100 分的理想分数。</br>
            对于每个具有严重性的发现<span class="danger">高</span> 我们从分数中减少 15.</br>
            For every findings with severity <span class="warning">警告</span> 减10分.</br>
            For every findings with severity <span class="success">好</span> 加5分.</br>
  如果计算的分数大于 100，则应用安全分数视为 100.</br>
            如果计算的分数小于 0，则应用安全分数被视为 10.</br>
        </p>
        <h3> 风险计算</h3>
        <p>
        <table class="basic">
            <thead>
            <tr>
                <th>应用安全分数</th>
                <th>风险</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td width="50%">0 - 15</td>
                <td><span class="danger">危急</span></td>
            </tr>
            <tr>
                <td>16 - 40</td>
                <td><span class="high">高</span></td>
            </tr>
            <tr>
                <td>41 - 70</td>
                <td><span class="warning">中</span></td>
            </tr>
            <tr>
                <td>71 - 100</td>
                <td><span class="success">低</span></td>
            </tr>
            </tbody>
        </table>
        </p>
    </article>

    <article id="columns">
        </br>
        <hr>
        <h3>报告生成者 - MobSF {{ version }} </h3>
        <section>
            <p>

             移动安全框架 (MobSF) 是一种自动化的一体化移动应用程序 (Android/iOS/Windows) 渗透测试、恶意软件分析和安全评估框架，能够执行静态和动态分析。</p>
            <p>
                <strong>© {% now "Y" %} Mobile Security Framework - MobSF | <a href="https://ajinabraham.com">Ajin
                    Abraham</a> | <a href="https://opensecurity.in">OpenSecurity</a>.</strong>
            </p>
        </section>
    </article>
    </body>
    </html>
{% endblock %}
